package com.fileshare.web.entity;

import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.command.BaseModel;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.*;

import java.util.Date;

import static com.fileshare.web.constant.EntityConstant.SEQ_LEN;
import static com.fileshare.web.constant.EntityConstant.TYPE_LEN;

/**
 * 文章资源
 */
@Table(name = "article")
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Article extends BaseModel {
    @Column(name = "id", type = MySqlTypeConstant.INT, length = 11, isKey = true, isAutoIncrement = true)
    private Integer id;

    @Column(name = "title", type = MySqlTypeConstant.VARCHAR, length = 256)
    private String title;

    @Column(name = "article_seq", type = MySqlTypeConstant.VARCHAR, length = SEQ_LEN)
    private String articleSeq;

    @Column(name = "summary", type = MySqlTypeConstant.VARCHAR, length = 512)
    private String summary;

    @Column(name = "content", type = MySqlTypeConstant.TEXT)
    private String content;

    @Column(name = "has_payment", type = MySqlTypeConstant.BIT)
    private Boolean hasPayment;

    @Column(name = "has_resource", type = MySqlTypeConstant.BIT)
    private Boolean hasResource;

    @Column(name = "has_limit", type = MySqlTypeConstant.BIT)
    private Boolean hasLimit;

    @Column(name = "views", type = MySqlTypeConstant.INT)
    private Integer views;

    @Column(name = "likes", type = MySqlTypeConstant.INT)
    private Integer likes;

    @Column(name = "dislikes", type = MySqlTypeConstant.INT)
    private Integer dislikes;

    @Column(name = "comment_count", type = MySqlTypeConstant.INT)
    private Integer commentCount;

    @Column(name = "status", type = MySqlTypeConstant.VARCHAR, length = 32)
    private String status;

    @Column(name = "allow_comment", type = MySqlTypeConstant.BIT)
    private Boolean allowComment;

    @Column(name = "self_view", type = MySqlTypeConstant.BIT)
    private Boolean selfView;

    @Column(name = "allow_likes", type = MySqlTypeConstant.BIT)
    private Boolean allowLikes;

    @Column(name = "category_seq", type = MySqlTypeConstant.VARCHAR, length = SEQ_LEN)
    private String categorySeq;

    @Column(name = "cover_image", type = MySqlTypeConstant.VARCHAR, length = 256)
    private String coverImage;

    @Column(name = "document_type", type = MySqlTypeConstant.VARCHAR, length = TYPE_LEN)
    private String documentType;

    @Column(name = "refer_module", type = MySqlTypeConstant.VARCHAR, length = TYPE_LEN)
    private String referModule;

    @Column(name = "create_at", type = MySqlTypeConstant.DATETIME)
    private Date createAt;

    @Column(name = "update_at", type = MySqlTypeConstant.DATETIME)
    private Date updateAt;

    @Column(name = "create_by", type = MySqlTypeConstant.CHAR, length = SEQ_LEN)
    private String createBy;

    @Column(name = "update_by", type = MySqlTypeConstant.CHAR, length = SEQ_LEN)
    private String updateBy;
}
